Repository navigation
fix(libc): find a relinked module by stem when the exact name misses (carries #6226) - #8626
Conversation
A title asks for a module by its console name and the relinker names the converted module after the ELF it was built from: Unity IL2CPP titles load Media/Modules/<name>.prx and Media/Plugins/<name>.prx while the dump holds <name>.elf.guest.prx, so sceKernelLoadStartModule failed with 0x80020002 and the title stopped 3 s after start. After the exact and the case-insensitive <name>.guest.prx lookups miss, take the sibling whose stem matches the request and ends with .guest.prx, shortest name first.
…n only The stem of a request and of a relinked module name was cut at the first dot, so a request for Engine.Render.prx that missed could load Engine.Core.prx.guest.prx. Only the last extension is removed now, as the review of the stem lookup asked, and the variant-names test requests a dotted name that must not load the sibling fixture module. Co-Authored-By: lendinglibrary <340867775+lendinglibrary@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
| WORKING_DIRECTORY "$<TARGET_FILE_DIR:guest_module_fixture>" RESOURCE_LOCK guest_dynamic_loader_files) | ||
| endif() | ||
| file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/variant_names") | ||
| file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/variant_names/guest_module_fixture.sprx.elf.GUEST.PRX" "not a module\n") |
There was a problem hiding this comment.
This fixture no longer exercises the shortest-match or dangling-symlink-before-valid-candidate paths after the last-extension change. For the request guest_module_fixture.prx, SameRelinkedStem strips .GUEST.PRX and then only the last extension: guest_module_fixture.sprx.elf.GUEST.PRX yields stem guest_module_fixture.sprx, and the symlink name ending in .zprx.elf.GUEST.PRX yields guest_module_fixture.zprx. Neither matches guest_module_fixture; only the copied .elf.GUEST.PRX file matches. Could the decoy and symlink instead be named e.g. guest_module_fixture.sprx.GUEST.PRX and guest_module_fixture.zprx.GUEST.PRX? Those share the requested stem under this rule and would make the selection/error-path coverage real.
… for the stem With the stem cut at the last extension, the decoy guest_module_fixture.sprx.elf.GUEST.PRX and the dangling link guest_module_fixture.zprx.elf.GUEST.PRX had the stems guest_module_fixture.sprx and guest_module_fixture.zprx, so they no longer matched the request and the shortest-name rule was not exercised. They are now guest_module_fixture.sprx.GUEST.PRX and guest_module_fixture.zprx.GUEST.PRX, which have the request's stem and are longer than the real module copy. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Good catch, thank you. After the cut at the last extension the decoy and the dangling link no longer had the request's stem, so the shortest-name rule was not exercised any more. I renamed them as you suggested ( |
|
@xXPBSXx I merged current #7467 added an early return to bool stem = false;
for (const auto& name : names) stem = stem || name.stem;
if (!stem && CaseInsensitiveDirectoryWindows(directory)) return MatchNamesWindows(directory, names);
|
Co-authored-by: xXPBSXx <20614131+xXPBSXx@users.noreply.github.com>
2de9386 to
8cb7251
Compare
|
Note: I force-pushed the merge commit as |
What
Carries #6226 (@lendinglibrary) onto current
main, keeping the original commit and its author (a3c4cdcdbb), and adds one commit that addresses the review points on #6226 (the author has not pushed since 15 October). The problem and the Unity IL2CPP evidence are those described in #6226: a title asks for a module by its console name, the relinker names the converted module after the ELF it was built from, soRelinkedModulePathmisses andsceKernelLoadStartModulefails with0x80020002; after the exact<name>.guest.prxand the case-insensitive lookup both miss, the lookup takes the sibling with the same stem that ends with.guest.prx.Changes on top of the original commit:
Engine.Render.prxno longer matchesEngine.Core.prx.guest.prx); the review on fix(libc): find a relinked module by stem when the exact name misses #6226 asked for this (cut at the first dot before).guest_module_fixture.other.prx).mainb85d972f42; the only conflict was the shared line indocs/dev/debt/libc.md(the original addition is kept).Fixes: none.
#6226stays open so its author can answer; if the author prefers to push the review fixes there, this PR can be closed.Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release, on
main+ this branch:guest_dynamic_loader_variant_names: fails (failed at GuestDynamicLoaderVariants.cpp:22, exit 0xc0000409) with the cut at the first dot (new case kept) and passes with the last extension;guest_dynamic_loaderandguest_filesystempass, 3 of 3 runs.python tools/check_conventions.py --base upstream/main: 0 errors, 1 warning (debt-length: the libc.md entry over 1000 characters comes from the original commit).git merge-treeof this branch with fix(libc): find a relinked module by stem when the exact name misses #6226 has three conflicts (the same code, expected); withupstream/mainit is clean.pr_overlapwas not run.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code